tzinfo not required
Reported by frison | May 22nd, 2009 @ 05:40 PM
add_subcomponent fails. Could require 'tzinfo' in sample below, but that doesn't seem right.
!/us/bin/ruby
require 'rubygems'
require 'ri_cal'
timezone = <<eos
BEGIN:VTIMEZONE
TZID:America/Denver
X-LIC-LOCATION:America/Denver
BEGIN:DAYLIGHT
TZOFFSETFROM:-0700
TZOFFSETTO:-0600
TZNAME:MDT
DTSTART:19700308T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:-0600
TZOFFSETTO:-0700
TZNAME:MST
DTSTART:19701101T020000
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
END:STANDARD
END:VTIMEZONE
eos
cheap_groceries = <<eos
BEGIN:VEVENT
DTSTART;TZID=America/Denver:20090414T133000
DTEND;TZID=America/Denver:20090414T143000
RRULE:FREQ=MONTHLY;BYDAY=2TU;WKST=MO
DTSTAMP:20090508T200622Z
UID:bcitgfe061at69cmnjo4403dbc@google.com
CLASS:PRIVATE
CREATED:00001231T000000Z
DESCRIPTION:
LAST-MODIFIED:20090416T184131Z
LOCATION:
SEQUENCE:1
STATUS:CONFIRMED
SUMMARY:Safeway
TRANSP:OPAQUE
END:VEVENT
eos
tz = RiCal.parse_string(timezone).pop
cg = RiCal.parse_string(cheap_groceries).pop
cal = RiCal::Component::Calendar.new
cal.add_subcomponent(tz)
cal.add_subcomponent(cg)
puts "#{cal.events}"
=begin Fails:
/usr/lib/ruby/gems/1.8/gems/ri_cal-0.0.10/lib/ri_cal/required_timezones.rb:15:in
initialize': uninitialized constant
RiCal::RequiredTimezones::RequiredTimezone::TZInfo (NameError) from
/usr/lib/ruby/gems/1.8/gems/ri_cal-0.0.10/lib/ri_cal/required_timezones.rb:52:in
new'
from
/usr/lib/ruby/gems/1.8/gems/ri_cal-0.0.10/lib/ri_cal/required_timezones.rb:52:in
add_datetime' from
/usr/lib/ruby/gems/1.8/gems/ri_cal-0.0.10/lib/ri_cal/property_value/date_time.rb:295:in
add_date_times_to'
from
/usr/lib/ruby/gems/1.8/gems/ri_cal-0.0.10/lib/ri_cal/component.rb:190:in
add_property_date_times_to' from
/usr/lib/ruby/gems/1.8/gems/ri_cal-0.0.10/lib/ri_cal/properties/event.rb:1501:in
add_date_times_to'
from
/usr/lib/ruby/gems/1.8/gems/ri_cal-0.0.10/lib/ri_cal/component/calendar.rb:72:in
add_subcomponent' from ./test.rb:51 =end
Comments and changes to this ticket
-
Rick DeNatale May 22nd, 2009 @ 07:54 PM
- State changed from new to invalid
RiCal is specifically designed NOT to require the tzinfo gem itself.
It will work with either the tzinfo gem or the tzinfo implementation which has been available in Rails/ActiveSupport since version 2.2.
The choice of which, and the responsibility is up to the client.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
A new icalendar data (RFC 2445) gem for Ruby which supports time zones and enumeration of occurrences